package com.qd.panda.service.mall;

import com.cdqidi.valid.group.DefaultGroup;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 商城订单
 * @author sjk
 */
@Data
@Accessors(chain = true)
public class MallOrderDTO {
    /**
     * 产品编号
     */
    @NotBlank(message = "产品编号不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "产品编号长度不能超过{max}位", groups = DefaultGroup.class)
    private String commodityId;
    /**
     * 充值账号
     */
    @NotBlank(message = "充值账号不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "充值账号长度不能超过{max}位", groups = DefaultGroup.class)
    private String rechargeAccount;
    /**
     * 充值数量
     */
    @NotNull(message = "充值量不能为空", groups = DefaultGroup.class)
    private Long rechargeValue;

    public void freeData() {
        this.rechargeAccount = null;
        this.rechargeValue = null;
        this.commodityId = null;
    }
}
